package BeenChina.PM.Model;

import java.util.ArrayList;
import java.util.List; 

public class ModelNavigation {
	public ModelNavigation(){}
	
	public ModelNavigation(String id,String name){
		this.navId = id;
		this.navMenuName = name;
	}
	
	private String navMenuName,navId;
	private List<ModelNavigationItem> items;
	
	public void setNavMenuName(String value){ 
		navMenuName = value;
	}
	
	public String getNavMenuName(){ 
		return navMenuName;
	}
	
	public void setNavId(String value){
		navId=value;
	}
	
	public String getNavId(){ 
		return navId;
	}
			
	public void setItems(List<ModelNavigationItem>  value){
		items = value;
	}
	
	public List<ModelNavigationItem> getItems(){		
		return items;
	}
	
	public void addItems(ModelNavigationItem  value){
		if (items==null)
			items = new ArrayList<ModelNavigationItem>();
		if (!items.contains(value))
			items.add(value);	 
	}
	
	@Override
	public boolean equals(Object obj) {
		if (obj == null) return false;
	    if (obj == this) return true;
		if (!(obj instanceof ModelNavigation)) return false;
		ModelNavigation other  =(ModelNavigation)obj;
		if (other.navId.equals(navId)){
			return true;
		}
		else {
			return false;
		}		  
	}	 
}
